;;; Copyright (c) 1999 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation; either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, see https://gnu.org/licenses or
;;; write to:
;;;  Free Software Foundatiom, Inc.
;;;  51 Franklin St, Fifth Floor
;;;  Boston, MA 02110-1301
;;;  USA

IFN 0,[
.AUXIL
]

IF1,[
.TYO6 .IFNM1
.TYO 40
.TYO6 .IFNM2
PRINTX / included in this assembly.
/
];IF1

IFNDEF DEFSYM,[	;ALLOW USER TO USE SYMBOLS IN OTHER WAYS IF HE WISHES.
		;BUT NORMALLY, DEFSYM FOO==BAR DOES FOO==BAR WITH ERROR CHECK.
DEFINE DEFSYM X/
IRPS Z,,[X]
IFNDEF Z,X
.ELSE [
   $$TEM1==Z
   X
   IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
]
.ISTOP
TERMIN TERMIN

IFLE .MLLIT,.ERR .MLLIT MUST BE 1; SETTING IT TO 1.
.MLLIT==1
$$TEMP==1
]
.ELSE $$TEMP==0



IFNDEF EPT, EPT=1000		;ABSOLUTE LOCATION OF EPT
				;LOCS 0-1777 UNCACHED
				;BUT THE HARDWARE CACHES EPT REFERENCES ANYWAY

DEFSYM	PI0LOC=EPT+40		;PI0LOC+2*PICHN = ADDRESS OF INSTR PAIR FOR PICHN

DEFSYM	DTEBPO=EPT+140		;DTE20 OUTPUT (BYTE TRANSFER) BYTE POINTER
DEFSYM	DTEBPI=EPT+141		;DTE20 INPUT (BYTE TRANSFER) BYTE POINTER
DEFSYM	DTELOC=EPT+142		;DTE20 INTERRUPT INSTRUCTION
DEFSYM	DTEPRO=EPT+144		;DTE20 OUTPUT (EXAMINE) PROTECTION WORD
DEFSYM	DTERLO=EPT+145		;DTE20 OUTPUT (EXAMINE) RELOCATION WORD
DEFSYM	DTEPRI=EPT+146		;DTE20 INPUT (DEPOSIT) PROTECTION WORD
DEFSYM	DTERLI=EPT+147		;DTE20 INPUT (DEPOSIT) RELOCATION WORD

DEFSYM	EPTCLK=EPT+510		;DOUBLE WORD FOR CALENDAR CLOCK (TIME BASE)
DEFSYM	EPTPRF=EPT+512		;DOUBLE WORD FOR PERFORMANCE COUNTER
DEFSYM	EPTEBC==EPT+504		;DOUBLE WORD EBOX COUNT WHEN UPT=EPT
DEFSYM	EPTMBC==EPT+506		;DOUBLE WORD MBOX COUNT WHEN UPT=EPT
DEFSYM	TIMLOC=EPT+514		;INTERRUPT INSTRUCTION FOR INTERVAL TIMER

DEFSYM	EPTTR1=EPT+421		;EXEC MODE ARITH OVFL TRAP
DEFSYM	EPTTR2=EPT+422		;EXEC MODE PDL OV TRAP
DEFSYM	EPTTR3=EPT+423		;EXEC MODE TRAP 3 (1 PROCEED)

;UPT LOCATIONS - IN NON-TIME SHARING AND AT CLOCK LEVEL IN ITS UPT=EPT

;424 MUUO STORED HERE
;425 MUUO PC STORED HERE
;426 MUUO DATAI PAG, HERE
;430 MUUO NEW PC KERNEL NO TRAP
;431 . . K T
;432 . . S N T
;433 . . S T
;434 . . C N T
;435 . . C T
;436 . . P N T
;437 . . P T
;500 PAGE FAIL WORD STORED HERE IN DEC PAGING MODE
;501 PAGE FAIL PC STORED HERE IN DEC PAGING MODE
;502 PAGE FAIL NEW PC FROM HERE IN DEC PAGING MODE
;504-5 EBOX COUNT
;506-7 MBOX COUNT

DEFSYM	EPTPFW=EPT+500	;PAGE FAIL WORD STORED HERE IN ITS PAGING MODE
DEFSYM	PFOPC=EPT+501	;PAGE FAIL OLD PC STORED HERE IN ITS PAGING MODE
DEFSYM	PFNPC=EPT+502	;PAGE FAIL NEW PC OBTAINED FROM HERE IN ITS PAGING MODE

;LOW CORE
;0-200 DF10S CHANNEL PROGRAMS, INTERRUPT LOCATIONS FOR IMP INTERFACE
;400-500 DTE20 COMMUNICATION AREA (COMMUNICATE WITH KLDCP AND IOELEV)
;500-1000 DL10 COMMUNICATION AREA AND BUFFERS (COMMUNICATE WITH IOELEV)

DEFSYM	QICWA=32		;ITS DISK ICWA
DEFSYM	QIOWD=160		;ITS DISK IOWD AREA

DEFSYM	MICWA=30		;ITS TAPE ICWA
DEFSYM	MIOWD=170		;ITS TAPE IOWD AREA

;LUUO IN EXEC MODE LOCATIONS 40,41

DEFSYM	SLVICW=60		;SALVAGER ICWA
DEFSYM	SLVIOW=62		;SALVAGER IOWD AREA

;EXEC DDT'S DISK ROUTINES USE LOCATIONS 20 AND 21, BUT THEY SAVE AND RESTORE THEM

DEFSYM	IMPILC=70		;IMPTERFACE INPUT INTERRUPT INSTRUCTION PAIR
DEFSYM	IMPOLC=72		;IMPTERFACE OUTPUT INTERRUPT INSTRUCTION PAIR

;DTE20 STUFF AS DEFINED BY KLDCP, ETC.
;THE DOCUMENTATION CLAIMS THIS STUFF IS IN THE EPT, BUT ACTUALLY
;IT'S IN FIXED LOCATIONS IN LOW CORE.

DEFSYM	EPTDIA=440		;DIAGNOSTIC (SALV) START ADDRESS
DEFSYM	EPTDDT=441		;DDT START ADDRESS
DEFSYM	EPTSTL=442		;LOADER (DSKDMP) START ADDRESS
DEFSYM	EPTITS=443		;MONITOR (ITS) START ADDRESS

DEFSYM	DTEFLG=444		;DTE20 OPERATION COMPLETE FLAG (SET BY 11, CLEARED BY 10)
DEFSYM	DTECLK=445		;DTE20 CLOCK INTERRUPT FLAG (SET BY 11, CLEARED BY 10)
;DEFSYM	DTECI=446		;DTE20 CLOCK INTERRUPT INSTRUCTION (USED BY 10 SOFTWARE)
DEFSYM	DTET11=447		;DTE20 10->11 ARGUMENT (SET BY 10) (NOT USED?)
DEFSYM	DTEF11=450		;DTE20 11->10 ARGUMENT (SET BY 11)
DEFSYM	DTECMD=451		;DTE20 10->11 COMMAND WORD (SET BY 10)
DEFSYM	DTESEQ=452		;DTE20 OPERATION SEQUENCE NUMBER (AOS BY 10)
DEFSYM	DTEOPR=453		;DTE20 OPERATION IN PROGRESS FLAG (SET/CLEARED BY 10)
DEFSYM	DTECHR=454		;DTE20 LAST TYPED CHARACTER (SET BY 11, CLEARED BY 10)
DEFSYM	DTEMTO=455		;DTE20 MONITOR-MODE TYPEOUT DONE FLAG (SET BY 11, CLEARED BY 10)
DEFSYM	DTEMTI=456		;DTE20 MONITOR-MODE TYPEIN DONE FLAG (SET BY 11, CLEARED BY 10)
DEFSYM	DTESWR=457		;DTE20 SIMULATED SWITCH REGISTER (SET BY 11 ON START)

DEFSYM	DTE==200		;DTE20 #0 DEVICE CODE
DEFSYM	 %DBL11==20000		;CONO BIT TO "DOORBELL" 11
DEFSYM	 %DBL10==1000		;CONI BIT FOR DOORBEL FROM 11.  CONO BIT TO CLEAR.
;1.1-1.3 DTE20 PIA

;WORDS STORED IN DTECMD

DEFSYM	%DTTTI==2400		;BUFFERED INPUT.  CHAR RETURNED IN DTEF11 AFTER LINE TYPED.
;NUMBER 0-377 IS CHAR TO BE TYPED OUT (FLUSHES INPUT. BUFFER NOT PRINTED UNTIL LF/^G/^@)
DEFSYM	%DTTTO==2000		;THIS + CHAR ALSO = TTY OUTPUT
DEFSYM	%DTTYI==3400		;"DDT" INPUT, CHAR RETURNED IN DTEF11, ZERO IF NO CHAR TYPED
DEFSYM	%DTTYO==4000		;THIS + CHAR = ITS (MONITOR) TTY OUTPUT.
				;WHEN TYPEOUT DONE, INTERRUPT WITH DTEMTO SET.
				;TYPEIN CAUSES INTERRUPT WITH DTEMTI SET, CHAR IN DTEF11.
DEFSYM	%DTMMN==4400		;MONITOR MODE ON (DEFAULT WHEN START)
DEFSYM	%DTMMF==5000		;MONITOR MODE OFF (TYPEIN OF A ^X DOES THIS ALSO)
DEFSYM	%DTMMS==5400		;RETURN MONITOR MODE STATE IN DTEF11
;DEFSYM	%DTNRM==3000		;NORMAL PRINT MODE
;DEFSYM	%DTFRC==3001		;FORCED PRINT MODE
DEFSYM	%DTCLN==1001		;CLOCK ON (60 CYCLE SIMULATED CLOCK)
DEFSYM	%DTCLF==1000		;CLOCK OFF
;DEFSYM	%DTCLW==1002		;"CLOCK WAIT" DTET11 HAS COUNT (? WHAT THE HECK IS THIS?)
;DEFSYM	%DTCLR==1003		;RETURN "CLOCK COUNT" IN DTEF11 (? WHAT THE HECK IS THIS?)
DEFSYM	%DTHLT==400		;HALT
;DEFSYM	%DTFTL==401		;DIAG FATAL ERROR (ACTUALLY JUST TURNS OFF CLOCK)
;DEFSYM	%DTERR==402		;DIAG ERROR HALT (ACTUALLY JUST TURNS OFF CLOCK)
;DEFSYM	%DTEPG==403		;END OF DIAGNOSTIC PROGRAM
;DEFSYM	%DTEOP==404		;END OF DIAGNOSTIC PASS
;DEFSYM	%DTCLK==405		;GET "CLOCK DEFAULT WORD"
;DEFSYM	%DTFSL==406		;DIAMON FILE SELECT (NAME.EXT MUST HAVE BEEN %DTTTO'ED)
;DEFSYM	%DTFRD==407		;DIAMON FILE READ (5 CHARS OR -1 (EOF) RETURNED IN DTEF11)
;DEFSYM	%DTCMD==410		;KLDCP COMMAND EXECUTED FROM OUTPUT BUFFER (%DTTTO IT)
;DEFSYM	%DTRSW==1400		;RETURN SIMULATED SWITCHES IN DTEF11.  10 SHOULD THEN STORE IN DTESWR


IFN $$TEMP,EXPUNG DEFSYM
